<?php $this->load->view('layout/header');?>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <h3 class="page-title">网站设置<small> 推广专题管理</small></h3>
            <?php echo breadcrumb(array('网站设置', '推广专题管理')); ?>
        </div>
    </div>
    <?php echo execute_alert_message() ?>
    <div class="row-fluid">
        <div class="span12">
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="icon-search"></i>搜索</div>
                    <div class="tools">
                        <a class="collapse" href="javascript:;"></a>
                        <a class="remove" href="javascript:;"></a>
                    </div>
                </div>
                <div class="portlet-body form">
                    <form class="form-horizontal form-search" action="<?php echo base_url('promotionproject/grid') ?>" method="get">
                        <div class="row-fluid">
                            <div class="span4">
                                <div class="control-group">
                                    <label class="control-label">专题名称</label>
                                    <div class="controls">
                                        <input type="text" class="m-wrap medium" name="name" value="<?php echo $this->input->get('name') ?>">
                                    </div>
                                </div>
                            </div>
                            <div class="span4">
                                <div class="control-group">
                                    <label class="control-label">专题所属</label>
                                    <div class="controls">
                                        <select class="medium m-wrap" name="belong">
                                            <option value="-1">全部</option>
                                            <?php foreach ($belong as $key=>$value):?>
                                            <option value="<?php echo $key?>" <?php if ((string)$key === $this->input->get('belong')):?>selected="selected"<?php endif;?>><?php echo $value;?></option>
                                            <?php endforeach;?>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="span4">
                                <div class="control-group">
                                    <label class="control-label">专题来源</label>
                                    <div class="controls">
                                        <select class="medium m-wrap" name="version">
                                            <option value="-1">全部</option>
                                            <?php foreach ($version as $k=>$v):?>
                                            <option value="<?php echo $k?>" <?php if ((string)$key === $this->input->get('version')):?>selected="selected"<?php endif;?>><?php echo $v;?></option>
                                            <?php endforeach;?>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-actions">
                            <button class="btn green" type="submit">搜索</button>
                            <button class="btn reset_button_search" type="button">重置条件</button>
                        </div>
                    </form>
                </div>
            </div>
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="icon-reorder"></i>列表</div>
                    <div class="tools">
                        <a class="collapse" href="javascript:;"></a>
                        <a class="remove" href="javascript:;"></a>
                    </div>
                </div>
                <div class="portlet-body flip-scroll">
                    <div class="dataTables_wrapper form-inline">
                        <div class="clearfix">
                            <a href="<?php echo base_url('promotionproject/add') ?>" class="add-button-link">
                                <div class="btn-group">
                                    <button class="btn green"><i class="icon-plus"></i> 添加</button>
                                </div>
                            </a>
                        </div>
                        <?php if ($all_rows > 0) :?>
                            <table class="table table-striped table-bordered table-hover" id="sample_1">
                                <thead class="flip-content">
                                    <tr>
                                        <th width="2%"><input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"></th>
                                        <th width="5%">编号</th>
                                        <th width="12%">专题名称</th>
                                        <th width="12%">专题所属</th>
                                        <th width="10%">专题来源</th>
                                        <th width="18%">专题logo</th>
                                        <th width="12%">URL地址</th>
                                        <th width="5%">排序</th>
                                        <th width="12%">添加时间</th>
                                        <th width="10%">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php foreach ($page_list->result() as $item) : ?>
                                    <tr>
                                        <td><input type="checkbox" class="checkboxes" value="1" ></td>
                                        <td><?php echo $item->id;?></td>
                                        <td><?php echo $item->name;?></td>
                                        <td><?php echo $belong[$item->belong];?></td>
                                        <td><?php echo $version[$item->version];?></td>
                                        <td><img src="<?php echo $this->config->show_image_thumb_url('promotion', $item->images)?>" alt="<?php echo $item->name;?>"></td>
                                        <td><?php echo $item->url;?></td>
                                        <td><?php echo $item->sort;?></td>
                                        <td><?php echo $item->created_at;?></td>
                                        <td>
                                            <p><a class="btn mini green" href="<?php echo base_url('promotionproject/edit/'.$item->id) ?>">编辑</a></p>
                                            <p><a class="btn mini green" href="<?php echo base_url('promotionproject/del/'.$item->id) ?>">删除</a></p>
                                        </td>
                                    </tr>
                                    <?php endforeach;?>
                                </tbody>
                            </table>
                            <div class="row-fluid">
                                <div class="dataTables_info">
                                    <span>当前第</span><span style="color: red"><?php echo $pg_now?></span>页 
                                    <span>共</span><span style="color: red"><?php echo $all_rows?></span>条数据
                                    <span>每页显示<?php echo $page_num ?>条 </span>
                                    <?php echo $pg_link ?>
                                </div>
                            </div>
                        <?php else: ?>
                            <div class="alert"><p>未找到数据。<p></div>
                        <?php endif ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $this->load->view('layout/footer');?>